package cn.com.nes.site.entity.vo.crm;

import cn.com.nes.common.util.XzqhUtils;
import cn.com.nes.site.entity.vo.PageVO;
import cn.com.nes.site.service.crm.customer.bo.CustomerPageBO;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@ApiModel("客户分页列表-入参模型")
@Data
public class QueryCustomerPageVo extends PageVO {

    @ApiModelProperty("关键字")
    private String keywords;

    @ApiModelProperty("行政区划代码")
    private String xzqhdm;

    @ApiModelProperty("客户性质")
    private String customerNature;

    @ApiModelProperty("客户级别")
    private String customerLevel;

    @ApiModelProperty("日期类型")
    private String dateType;

    @ApiModelProperty("客户所属人")
    private Long customerOwnerId;

    @ApiModelProperty("线索状态 01-已分配，02-未分配")
    private String customerState;

    @ApiModelProperty(value = "客户UUID")
    private String customerUuid;

    public CustomerPageBO convertToBo() {
        CustomerPageBO customerPageBO = new CustomerPageBO();
        BeanUtils.copyProperties(this, customerPageBO);
        if (StrUtil.isNotEmpty(xzqhdm)) {
            customerPageBO.setAreaCode(XzqhUtils.getRegionCodePrefix(xzqhdm));
        }
        return customerPageBO;
    }

}
